package com.hqyj.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hqyj.common.dao.SysUserMapper;
import com.hqyj.common.pojo.SysUserRole;
import com.hqyj.common.dao.SysUserRoleMapper;
import com.hqyj.common.service.ISysUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 用户角色表 服务实现类
 * </p>
 *
 * @author j0701-9
 * @since 2021-10-20
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService {
    @Resource
    SysUserRoleMapper userRoleMapper;

    @Override
    public SysUserRole queryUserRole(Integer userId) {
        QueryWrapper<SysUserRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id", userId);
        SysUserRole userRole = userRoleMapper.selectOne(queryWrapper);
        return userRole;
    }
}
